<template>
  <el-container class="jzrq">
    <el-aside class="cb" width="200">
      <el-menu class="cbxx" :default-active="active" @select="handleSelect" >
        <el-menu-item index="1">
          <i class="el-icon-menu"></i>
          <span slot="title">工作台</span>
        </el-menu-item>
        <el-menu-item index="2">
          <i class="el-icon-menu"></i>
          <span slot="title">作品管理</span>
        </el-menu-item>
        <el-menu-item index="3">
          <i class="el-icon-document"></i>
          <span slot="title">数据中心</span>
        </el-menu-item>
        <el-menu-item index="4">
          <i class="el-icon-setting"></i>
          <span slot="title">稿酬收入</span>
        </el-menu-item>
      </el-menu>
    </el-aside>
    <el-main>
      <router-view />
    </el-main>
  </el-container>
</template>

<script>
import NovelWorkbench from "./NovelWorkbench.vue";
import NovelWorkManagement from "./NovelWorkManagement.vue";
import { mapState, mapGetters, mapMutations, mapActions } from "vuex";
export default {
  components: { NovelWorkbench, NovelWorkManagement },
  data() {
    return {
    }
  },
  computed: {
    ...mapState("routeJump", {active:"WriterActive"}),
  },
  methods: {
    handleSelect(key, keyPath) {
      if (key == 1) {
        this.$router.push({
          name: "workbench",
        });
      } else if (key == 2) {
        this.$router.push({
          name: "workManagement",
        });
      }
    },
  },
};
</script>

<style scoped>
.jzrq {
  width: 64%;
  margin: 0 auto;
}
.cd {
  width: 200px;
}
.cbxx {
  overflow: hidden;
}
</style>